<%@tag pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@attribute name="item" required="true" type="cn.livingCloud.dto.ReplyRuleDto" %>

<td>${item.keyWord}</td>
<td>
    <c:if test="${not item.enable}">
        <span class="label label-danger">禁用</span>
    </c:if>
    <c:if test="${item.enable}">
        <span class="label label-success">启用</span>
    </c:if>
</td>
<td>
    <span class="label label-primary">${item.msgType.label}</span>
</td>
<td>
    <span class="label label-default">${item.dateTime}</span>
</td>
<td>
    <c:if test="${not item.enable}">
        <form class="form-inline" action="${contextPath}/admin/wechat/reply_rule_delete" method="post">
            <button type="button" class="btn btn-success ChangeState" uuid="${item.uuid}" state="true">启用
            </button>

            <a class="btn btn-warning"
               href="${contentPath}/admin/wechat/${item.msgType}/edit.htm?uuid=${item.uuid}">编辑</a>

            <a class="btn btn-warning" href="${contextPath}/admin/wechat/${item.msgType}/detail.htm?uuid=${item.uuid}">查看</a>

            <input type="hidden" name="uuid" value="${item.uuid}">
            <button class="btn btn-danger" type="submit"
                    onclick="javascript:return confirm('确定删除关键字[${item.keyWord}]的回复规则?');">
                删除
            </button>
        </form>
    </c:if>
    <c:if test="${item.enable}">
        <button type="button" class="btn btn-warning ChangeState" uuid="${item.uuid}" state="false">禁用
        </button>
        <a class="btn btn-warning" href="${contentPath}/admin/wechat/${item.msgType}/edit.htm?uuid=${item.uuid}">编辑</a>
        <a class="btn btn-warning"
           href="${contextPath}/admin/wechat/${item.msgType}/detail.htm?uuid=${item.uuid}">查看</a>
    </c:if>
</td>